package fy.config;

import org.apache.commons.logging.LogFactory;

import com.seeyon.ctp.common.AbstractSystemInitializer;
import com.seeyon.ctp.common.AppContext;

public class FyConfigInitializer extends AbstractSystemInitializer {
	@Override
	public void destroy() {
		LogFactory.getLog(FyConfigInitializer.class).info("销毁自定义配置模块**********");
		super.destroy();
	}

	@Override
	public void initialize() {
		LogFactory.getLog(FyConfigInitializer.class).info("启用自定义配置模块**********");
		super.initialize();
		
		FyConfig.setOA_DB_CONFIG(
				AppContext.getSystemProperty("fyConfig.fydb.connect.oa.user"),
				AppContext
						.getSystemProperty("fyConfig.fydb.connect.oa.password"),
				AppContext.getSystemProperty("fyConfig.fydb.connect.oa.url"),
				null,
				AppContext
						.getSystemProperty("fyConfig.fydb.connect.oa.driverClassName"));
		
		
		FyConfig.setEHR_DB_CONFIG(
				AppContext.getSystemProperty("fyConfig.fydb.connect.ehr.user"),
				AppContext
						.getSystemProperty("fyConfig.fydb.connect.ehr.password"),
				AppContext.getSystemProperty("fyConfig.fydb.connect.ehr.url"),
				AppContext.getSystemProperty("fyConfig.fydb.dblink.ehr.name"),
				AppContext
						.getSystemProperty("fyConfig.fydb.connect.ehr.driverClassName"));
		
		
		FyConfig.setERP_DB_CONFIG(
				AppContext.getSystemProperty("fyConfig.fydb.connect.erp.user"),
				AppContext
						.getSystemProperty("fyConfig.fydb.connect.erp.password"),
				AppContext.getSystemProperty("fyConfig.fydb.connect.erp.url"),
				AppContext.getSystemProperty("fyConfig.fydb.dblink.erp.name"),
				AppContext
						.getSystemProperty("fyConfig.fydb.connect.erp.driverClassName"));
		
		
		FyConfig.setUAP_DB_CONFIG(
				AppContext.getSystemProperty("fyConfig.fydb.connect.uap.user"),
				AppContext
						.getSystemProperty("fyConfig.fydb.connect.uap.password"),
				AppContext.getSystemProperty("fyConfig.fydb.connect.uap.url"),
				AppContext.getSystemProperty("fyConfig.fydb.dblink.uap.name"),
				AppContext
						.getSystemProperty("fyConfig.fydb.connect.uap.driverClassName"));
	}

}
